home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / programs_-_include / LINUX / SMB.H < prev    next >
C/C++ Source or Header  |  1999-09-17  |  3KB  |  124 lines

  1. /*
  2.  *  smb.h
  3.  *
  4.  *  Copyright (C) 1995, 1996 by Paal-Kr. Engstad and Volker Lendecke
  5.  *  Copyright (C) 1997 by Volker Lendecke
  6.  *
  7.  */
  8.  
  9. #ifndef _LINUX_SMB_H
  10. #define _LINUX_SMB_H
  11.  
  12. #include <linux/types.h>
  13.  
  14. enum smb_protocol { 
  15.     SMB_PROTOCOL_NONE, 
  16.     SMB_PROTOCOL_CORE, 
  17.     SMB_PROTOCOL_COREPLUS, 
  18.     SMB_PROTOCOL_LANMAN1, 
  19.     SMB_PROTOCOL_LANMAN2, 
  20.     SMB_PROTOCOL_NT1 
  21. };
  22.  
  23. enum smb_case_hndl {
  24.     SMB_CASE_DEFAULT,
  25.     SMB_CASE_LOWER,
  26.     SMB_CASE_UPPER
  27. };
  28.  
  29. struct smb_dskattr {
  30.         __u16 total;
  31.         __u16 allocblocks;
  32.         __u16 blocksize;
  33.         __u16 free;
  34. };
  35.  
  36. struct smb_conn_opt {
  37.  
  38.         /* The socket */
  39.     unsigned int fd;
  40.  
  41.     enum smb_protocol protocol;
  42.     enum smb_case_hndl case_handling;
  43.  
  44.     /* Connection-Options */
  45.  
  46.     __u32              max_xmit;
  47.     __u16              server_uid;
  48.     __u16              tid;
  49.  
  50.         /* The following are LANMAN 1.0 options */
  51.         __u16              secmode;
  52.         __u16              maxmux;
  53.         __u16              maxvcs;
  54.         __u16              rawmode;
  55.         __u32              sesskey;
  56.  
  57.     /* The following are NT LM 0.12 options */
  58.     __u32              maxraw;
  59.     __u32              capabilities;
  60.     __u16              serverzone;
  61. };
  62.  
  63. #ifdef __KERNEL__
  64.  
  65. #define SMB_MAXNAMELEN 255
  66. #define SMB_MAXPATHLEN 1024
  67.  
  68. /*
  69.  * Contains all relevant data on a SMB networked file.
  70.  */
  71. struct smb_fattr {
  72.  
  73.     __u16 attr;
  74.  
  75.     unsigned long    f_ino;
  76.     umode_t        f_mode;
  77.     nlink_t        f_nlink;
  78.     uid_t        f_uid;
  79.     gid_t        f_gid;
  80.     kdev_t        f_rdev;
  81.     off_t        f_size;
  82.     time_t        f_atime;
  83.     time_t        f_mtime;
  84.     time_t        f_ctime;
  85.     unsigned long    f_blksize;
  86.     unsigned long    f_blocks;
  87. };
  88.  
  89. struct smb_dirent {
  90.     struct smb_fattr attr;
  91.  
  92.     int f_pos;
  93.     int len;
  94.     __u8 name[SMB_MAXNAMELEN];
  95. };
  96.  
  97. enum smb_conn_state {
  98.         CONN_VALID,             /* everything's fine */
  99.         CONN_INVALID,           /* Something went wrong, but did not
  100.                                    try to reconnect yet. */
  101.         CONN_RETRIED            /* Tried a reconnection, but was refused */
  102. };
  103.  
  104. /*
  105.  * The readdir cache size controls how many directory entries are cached.
  106.  */
  107. #define SMB_READDIR_CACHE_SIZE        64
  108.  
  109. #define SMB_SUPER_MAGIC               0x517B
  110.  
  111. #define SMB_SERVER(inode)    (&(inode->i_sb->u.smbfs_sb))
  112. #define SMB_INOP(inode)      (&(inode->u.smbfs_i))
  113.  
  114. #define SMB_HEADER_LEN   37     /* includes everything up to, but not
  115.                                  * including smb_bcc */
  116. #define SMB_DEF_MAX_XMIT 32768
  117. #define SMB_INITIAL_PACKET_SIZE 4000
  118.  
  119. /* Allocate max. 1 page */
  120. #define TRANS2_MAX_TRANSFER (4096-17)
  121.  
  122. #endif
  123. #endif
  124.